<?php

namespace App\Http\Controllers\Applet\Notice;

use App\Services\Applet\Notice\SysMessageService;
use Exception;
use Illuminate\Http\JsonResponse;

class SysMessageController extends BaseNoticeController
{
    protected SysMessageService $sysMessageService;

    /**
     * @throws Exception
     */
    public function __construct()
    {
        parent::__construct();
        $this->sysMessageService = $this->loadService('Applet\Notice\SysMessageService');
    }

    /**
     * 消息
     * @return JsonResponse
     * @throws Exception
     */
    public function list(): JsonResponse
    {
        $list = $this->sysMessageService->list();
        return outputJsonResult($list);
    }
}
